﻿using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;
using System.IO;

namespace AlbumDownload
{
    public class ResolveJson
    {
        public static JsonData Deserialize(string json)
        {
            JsonSerializer serializer = new JsonSerializer();
            StringReader sr = new StringReader(json);
            return serializer.Deserialize<JsonData>(new JsonTextReader(sr));
        }

        public static string Serialize(JsonData obj)
        {
            JsonSerializer serializer = new JsonSerializer(); 
            StringWriter sw = new StringWriter();
            serializer.Serialize(new JsonTextWriter(sw), obj);
            return sw.GetStringBuilder().ToString();
        }
    }
}
